package com.sds.log;

import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("rawtypes")
public class LogFactory {
	
	private static Map<Class, Log> logMap;
	
	public static Log getLog(Class clazz) {
		if (logMap == null) {
			logMap = new HashMap<Class, Log>();
		}
		
		Log log = logMap.get(clazz);
		
		if (log == null) {
			log = createLog(clazz);
			logMap.put(clazz, log);
		}
		
		return log;
	}
	
	private static Log createLog(Class clazz) {
		return new ConsoleLog("[" + clazz.getCanonicalName() + "] : ");
	}
}


